package avicit.bdp.dms.perm.dto;

import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2022-10-09
 * @类说明：CategoryPermDTO
 * @修改记录：
 * @注意事项：
 * @主要功能：业务领域分类权限DTO
 */
@ApiModel(value = "CategoryPermDto", description = "业务领域分类权限DTO")
@Table(name = "bdp_dms_perm_category")
public class CategoryPermDTO extends BasePermDTO {
    private static final long serialVersionUID = 1L;

    /**
     * 分类节点ID
     */
    @LogField
    @ApiModelProperty(value = "分类节点ID")
    @FieldRemark(column = "node_id", field = "nodeId", name = "分类节点ID")
    @Column(name = "node_id")
    private String nodeId;

    /**
     * 分类节点名称
     */
    @LogField
    @ApiModelProperty(value = "分类节点名称")
    @FieldRemark(column = "node_name", field = "nodeName", name = "分类节点名称")
    @Column(name = "node_name")
    private String nodeName;

    /**
     * 关联节点ID。区分多个关联节点场景
     * 场景1：对当前节点的多个上层节点授权，表中会保留多份roleId+nodeId记录，再次授权时首先根据roleId+nodeId删除旧权限，如果不记录relatedNodeId
     *       会删除所有相关权限，逻辑错误。
     */
    @LogField
    @ApiModelProperty(value = "关联节点ID")
    @FieldRemark(column = "related_node_id", field = "relatedNodeId", name = "关联节点ID")
    @Column(name = "related_node_id")
    private String relatedNodeId;

    /**
     * 前后台传输数据使用
     */
    @Transient
    private List<Integer> actionList;

    public String getNodeId() {
        return nodeId;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public String getRelatedNodeId() {
        return relatedNodeId;
    }

    public void setRelatedNodeId(String relatedNodeId) {
        this.relatedNodeId = relatedNodeId;
    }

    public List<Integer> getActionList() {
        return actionList;
    }

    public void setActionList(List<Integer> actionList) {
        this.actionList = actionList;
    }
}
